# config.py 配置文件

# cookie 配置
SECRET_KEY = 'ljq'
JWT_SECRET_KEY = 'ljq'

JWT_ACCESS_TOKEN_EXPIRES = 8 # 8小时




# 配置缓存
CACHE_TYPE= 'simple'  # 使用简单的内存缓存
CACHE_DEFAULT_TIMEOUT= 300  # 缓存超时时间为 300 秒

# 上传路径
UPLOAD_FOLDER = 'static/imgs'
MAX_CONTENT_LENGTH = 5 * 1024  * 1024 # 5MB

# CORS 配置
cors=[
    '*',  # 允许前端域名访问
]

# 数据库配置
HOSTNAME = '127.0.0.1'
PORT = '3306'
USERNAME = 'root'
PASSWORD = 'root'
DATABASE = 'trivault'

DB_URI= f'mysql+pymysql://{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}/{DATABASE}?charset=utf8mb4'
SQLALCHEMY_DATABASE_URI = DB_URI 
# 连接池配置
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_POOL_SIZE = 20
SQLALCHEMY_POOL_TIMEOUT = 60
SQLALCHEMY_MAX_OVERFLOW = 50
SQLALCHEMY_POOL_RECYCLE = 1200

# 基本配置
# 邮件配置
# AHiD5cAuKr7zRn7E